package plugin

import (
	"net/rpc"

	"github.com/hashicorp/go-plugin"
)

// ----------------- 插件实现 -------------------
type Plugin_Plugin struct {
	// 插件实现 注入
	Impl Plugin_Interface
}

// ------------------- 插件外部接口 ----------------
func (s *Plugin_Plugin) Server(*plugin.MuxBroker) (interface{}, error) {
	return &Plugin_RpcServer{Impl: s.Impl}, nil
}

func (s *Plugin_Plugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error) {
	return &Plugin_RpcClient{Client: c}, nil
}
